package com.bwie.config;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName tourist
 */

@Data
@Document(indexName = "Tourist_0830", shards = 1, replicas = 1)
public class TouristInfo implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    @Id
    private Integer id;

    /**
     * 游客名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String touristName;

    /**
     * 手机号
     */
    @Field(type = FieldType.Keyword)
    private String phone;

    /**
     * 身份证
     */
    @Field(type = FieldType.Keyword)
    private String standing;

    /**
     * 性别
     */
    @Field(type = FieldType.Keyword)
    private String sex;

    /**
     * 年龄
     */
    @Field(type = FieldType.Keyword)
    private Integer age;

    /**
     * 住址
     */
    @Field(type = FieldType.Keyword)
    private String address;

    /**
     * 借书时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;

    /**
     * 借书理由
     */
    @Field(type = FieldType.Keyword)
    private String argument;

    /**
     * 对接团队
     */
    @Field(type = FieldType.Integer)
    private Integer teamId;

    /**
     * 团队人员
     */
    @Field(type = FieldType.Keyword)
    private String teamName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}